package com.tzy.user.controller;
import com.tzy.user.service.ESRestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class ESController {

    @Autowired
    private ESRestService esRestService;
    @GetMapping("/")
    public String all(){
        String article = "";
        article = esRestService.getStringById("","");
        return article;
    }
    @GetMapping("/search")
    public String search(String content ){
        String article = "";
        article = esRestService.searchArticle(content);
        return article;
    }
    @GetMapping("/delete")
    public long delete(String title ){
        long deleteNum = esRestService.deleteArticle(title);
        return deleteNum;
    }

}